3.53 \(\int (a+b \log (c x^n))^2 \, dx\)

Optimal. Leaf size=43 \[ x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x-2 b^2 n x \log \left (c x^n\right )+2 b^2 n^2 x \]

[Out]

-2*a*b*n*x + 2*b^2*n^2*x - 2*b^2*n*x*Log[c*x^n] + x*(a + b*Log[c*x^n])^2

________________________________________________________________________________________

Rubi [A]  time = 0.0128483, antiderivative size = 43, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {2296, 2295} \[ x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x-2 b^2 n x \log \left (c x^n\right )+2 b^2 n^2 x \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Log[c*x^n])^2,x]

[Out]

-2*a*b*n*x + 2*b^2*n^2*x - 2*b^2*n*x*Log[c*x^n] + x*(a + b*Log[c*x^n])^2

Rule 2296

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rubi steps

\begin{align*} \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=x \left (a+b \log \left (c x^n\right )\right )^2-(2 b n) \int \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=-2 a b n x+x \left (a+b \log \left (c x^n\right )\right )^2-\left (2 b^2 n\right ) \int \log \left (c x^n\right ) \, dx\\ &=-2 a b n x+2 b^2 n^2 x-2 b^2 n x \log \left (c x^n\right )+x \left (a+b \log \left (c x^n\right )\right )^2\\ \end{align*}

Mathematica [A]  time = 0.008462, size = 33, normalized size = 0.77 \[ x \left (\left (a+b \log \left (c x^n\right )\right )^2-2 b n \left (a+b \log \left (c x^n\right )-b n\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Log[c*x^n])^2,x]

[Out]

x*((a + b*Log[c*x^n])^2 - 2*b*n*(a - b*n + b*Log[c*x^n]))

________________________________________________________________________________________

Maple [A]  time = 0.05, size = 63, normalized size = 1.5 \begin{align*} x{a}^{2}+{b}^{2}x \left ( \ln \left ( c{{\rm e}^{n\ln \left ( x \right ) }} \right ) \right ) ^{2}+2\,{b}^{2}{n}^{2}x-2\,{b}^{2}nx\ln \left ( c{{\rm e}^{n\ln \left ( x \right ) }} \right ) +2\,xab\ln \left ( c{x}^{n} \right ) -2\,abnx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*ln(c*x^n))^2,x)

[Out]

x*a^2+b^2*x*ln(c*exp(n*ln(x)))^2+2*b^2*n^2*x-2*b^2*n*x*ln(c*exp(n*ln(x)))+2*x*a*b*ln(c*x^n)-2*a*b*n*x

________________________________________________________________________________________

Maxima [A]  time = 1.08919, size = 77, normalized size = 1.79 \begin{align*} b^{2} x \log \left (c x^{n}\right )^{2} - 2 \, a b n x + 2 \, a b x \log \left (c x^{n}\right ) + 2 \,{\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} + a^{2} x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

b^2*x*log(c*x^n)^2 - 2*a*b*n*x + 2*a*b*x*log(c*x^n) + 2*(n^2*x - n*x*log(c*x^n))*b^2 + a^2*x

________________________________________________________________________________________

Fricas [A]  time = 0.792463, size = 197, normalized size = 4.58 \begin{align*} b^{2} n^{2} x \log \left (x\right )^{2} + b^{2} x \log \left (c\right )^{2} - 2 \,{\left (b^{2} n - a b\right )} x \log \left (c\right ) +{\left (2 \, b^{2} n^{2} - 2 \, a b n + a^{2}\right )} x + 2 \,{\left (b^{2} n x \log \left (c\right ) -{\left (b^{2} n^{2} - a b n\right )} x\right )} \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

b^2*n^2*x*log(x)^2 + b^2*x*log(c)^2 - 2*(b^2*n - a*b)*x*log(c) + (2*b^2*n^2 - 2*a*b*n + a^2)*x + 2*(b^2*n*x*lo
g(c) - (b^2*n^2 - a*b*n)*x)*log(x)

________________________________________________________________________________________

Sympy [B]  time = 0.607413, size = 109, normalized size = 2.53 \begin{align*} a^{2} x + 2 a b n x \log{\left (x \right )} - 2 a b n x + 2 a b x \log{\left (c \right )} + b^{2} n^{2} x \log{\left (x \right )}^{2} - 2 b^{2} n^{2} x \log{\left (x \right )} + 2 b^{2} n^{2} x + 2 b^{2} n x \log{\left (c \right )} \log{\left (x \right )} - 2 b^{2} n x \log{\left (c \right )} + b^{2} x \log{\left (c \right )}^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*x**n))**2,x)

[Out]

a**2*x + 2*a*b*n*x*log(x) - 2*a*b*n*x + 2*a*b*x*log(c) + b**2*n**2*x*log(x)**2 - 2*b**2*n**2*x*log(x) + 2*b**2
*n**2*x + 2*b**2*n*x*log(c)*log(x) - 2*b**2*n*x*log(c) + b**2*x*log(c)**2

________________________________________________________________________________________

Giac [B]  time = 1.1966, size = 119, normalized size = 2.77 \begin{align*} b^{2} n^{2} x \log \left (x\right )^{2} - 2 \, b^{2} n^{2} x \log \left (x\right ) + 2 \, b^{2} n x \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} n^{2} x - 2 \, b^{2} n x \log \left (c\right ) + b^{2} x \log \left (c\right )^{2} + 2 \, a b n x \log \left (x\right ) - 2 \, a b n x + 2 \, a b x \log \left (c\right ) + a^{2} x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

b^2*n^2*x*log(x)^2 - 2*b^2*n^2*x*log(x) + 2*b^2*n*x*log(c)*log(x) + 2*b^2*n^2*x - 2*b^2*n*x*log(c) + b^2*x*log
(c)^2 + 2*a*b*n*x*log(x) - 2*a*b*n*x + 2*a*b*x*log(c) + a^2*x